// 支付相关接口
import request from '@/utils/request'

enum API {
  // 获取微信支付参数
  PayWxPayMiniPay_URL = '/pay/wxPay/miniPay',
  // 模拟支付-内测版
  PayMock_URL = '/pay/mock'
}

/**
 * 获取微信支付参数
 * @param {string} data orderId 订单id
 */
export const reqPayWxPayMiniPay = (data: { orderId: string }) => {
  return request<WechatMiniprogram.RequestPaymentOption>({
    method: 'GET',
    url: API.PayWxPayMiniPay_URL,
    data
  })
}

/**
 * 模拟支付-内测版
 * @param {string} data orderId 订单id
 */
export const reqPayMock = (data: { orderId: string }) => {
  return request({
    method: 'GET',
    url: API.PayMock_URL,
    data
  })
}
